package velox.jcr.mapper;

import javax.jcr.RepositoryException;
import javax.jcr.Session;


public interface MapperManager {

	<T> T get(NodeRef nr, Class<T> type) throws RepositoryException;
	
	<T> T update(T t) throws RepositoryException;
	<T> void remove(T t) throws RepositoryException;

	<T> T persist(NodeRef parent, String name, T t) throws RepositoryException;

	void save() throws RepositoryException;
	Session getSession();

	void addMapperDefinition(MapperDefinition<?> mapperDefinition);
	public <T> Mapper<T> getMapper(T t, NodeRef nodeReference) throws RepositoryException;
	public <T> Mapper<T> getMapper(Class<? super T> type, NodeRef nodeReference) throws RepositoryException;
}
